<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>清除右侧浮动效果</title>
    <style>
        .container{
            width: 1000px;
            height: 800px;
            border: 1px solid red;
        }
        .c1{
            width: 200px;
            height: 100px;
            background-color: green;
            float: right;
        }
        /*
            当c1设置了向右浮动,c2会受到c1的浮动效果的影响导致其位置上移
            即:此时的c2右侧存在浮动,可以通过清除右侧浮动效果使得c2不再上移
        */
        .c2{
            width: 200px;
            height: 100px;
            background-color: blue;
            /*float: left;*/
            clear: both;
        }
    </style>
</head>
<body>
<div class="container">
    <div class="c1"></div>
    <div class="c2"></div>
</div>
</body>
</html>